package com.nbjtjc.safe.util;

public enum FREQUENCYENUM {
    ONEHOUR("每1小时",1) ,TWOHOUR("每2小时",2),FOURHOUR("每4小时",3)
    ,EIGHTHOUR("",4),ONEDAY("每天一次",5),ONEWEEK("每周一次",6),HALFMONTH("15天一次",7)
    ,ONEMONTH("每月一次",8),ONEQUARTER("每季度一次",9);

    private String name;
    private Integer code;

    FREQUENCYENUM(String name, Integer code) {
        this.name = name;
        this.code = code;
    }


    public static String getName(Integer code){
        for(FREQUENCYENUM frequencyEnum : FREQUENCYENUM.values()){
            if(frequencyEnum.getCode().equals(code)){
                return frequencyEnum.getName();
            }
        }
        return "";
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}


